package com.jay.publisher.app.ui

import android.content.Intent
import android.os.Bundle
import android.view.View
import android.widget.Button
import androidx.appcompat.app.AppCompatActivity
import com.jay.publisher.app.MainActivity
import com.jay.publisher.app.R

class HomeActivity : AppCompatActivity(), View.OnClickListener {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_home)

        findViewById<Button>(R.id.publishButton).setOnClickListener(this)
        findViewById<Button>(R.id.playButton).setOnClickListener(this)
    }

    override fun onClick(v: View?) {
        when (v?.id) {
            R.id.publishButton -> {
                startActivity(Intent(this, MainActivity::class.java))
            }
            R.id.playButton -> {
                startActivity(Intent(this, PlayerActivity::class.java))
            }
            else -> {
            }
        }
    }
}